<template>
  <div class="home">
    home
    <transition name="fade">
      <p v-if="isShow">show</p>
    </transition>
    <button @click="handleClick">切换</button>
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  name: "Home",
  data() {
    return {
      isShow: false,
    };
  },
  methods: {
    handleClick() {
      this.isShow = !this.isShow;
    },
  },
};
</script>

<style scoped>
  .fade-enter{
    opacity: 0;
  }
  .fade-leave-to{
    opacity: 0;
  }
  .fade-enter-active,.fade-leave-active{
    transition: opacity 1s;
  }
</style>
